<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1">
<title>隐私设置</title>
<link rel="stylesheet" type="text/css" href="../addons/amouse_ecard/style/css/reset.css">
<link rel="stylesheet" type="text/css" href="../addons/amouse_ecard/style/css/flytip.css">
<link rel="stylesheet" type="text/css" href="../addons/amouse_ecard/style/css/nameCard.css?v=2014122">
<style type="text/css">
	html,body{
		background: #fff;
	}
</style>
</head>

<body class="namecard-settings">

<!--#=start page-->
<div class="namecard-page"> 
  
  <!--#=start create-title-->
  <!--#=end create-title--> 
  
  <!--#=start column-->
  <section class="settings-column">
  		<div class="settings-box">
      	<div class="settings-box-title" >手机</div>
        <ul class="settings-inner" data-type="1">
          <li class="settings-inner-item {if $card['mobile'] == 0} cur {/if} " data-visible="0">
            <span class="vertical-m">全部可见</span>
          </li>
          <li class="settings-inner-item {if $card['mobile'] == 1} cur {/if}" data-visible="1">
            <span class="vertical-m" >互收藏可见</span>
          </li>
          <li class="settings-inner-item {if $card['mobile'] == 2} cur {/if}" data-visible="2">
            <span class="vertical-m " >自己可见</span>
          </li>
        </ul>
      </div>
      <div class="settings-box" >
      	<div class="settings-box-title">邮箱</div>
        <ul class="settings-inner" data-type="2">
          <li class="settings-inner-item {if $card['email'] == 0} cur {/if}" data-visible="0">
            <span class="vertical-m">全部可见</span>
          </li>
          <li class="settings-inner-item {if $card['email'] == 1} cur {/if}" data-visible="1">
            <span class="vertical-m " >互收藏可见</span>
          </li>
          <li class="settings-inner-item {if $card['email'] == 2} cur {/if}" data-visible="2">
            <span class="vertical-m" >自己可见</span>
          </li>
        </ul>
      </div>
      <div class="settings-box" >
      	<div class="settings-box-title">微信</div>
        <ul class="settings-inner" data-type="3">
          <li class="settings-inner-item {if $card['weixin'] == 0} cur {/if}" data-visible="0">
            <span class="vertical-m">全部可见</span>
          </li>
          <li class="settings-inner-item {if $card['weixin'] == 1} cur {/if}" data-visible="1">
            <span class="vertical-m "  >互收藏可见</span>
          </li>
          <li class="settings-inner-item {if $card['weixin'] == 2} cur {/if}" data-visible="2">
            <span class="vertical-m " >自己可见</span>
          </li>
        </ul>
      </div>
      <div class="settings-box" >
      	<div class="settings-box-title ">地址</div>
        <ul class="settings-inner" data-type="4">
          <li class="settings-inner-item {if $card['address'] == 0} cur {/if}" data-visible="0">
            <span class="vertical-m">全部可见</span>
          </li>
          <li class="settings-inner-item {if $card['address'] == 1} cur {/if}" data-visible="1">
            <span class="vertical-m">互收藏可见</span>
          </li>
          <li class="settings-inner-item {if $card['address'] == 2} cur {/if}" data-visible="2">
            <span class="vertical-m">自己可见</span>
          </li>
        </ul>
      </div>
      <div class="settings-box" >
      	<div class="settings-box-title ">qq</div>
        <ul class="settings-inner" data-type="5">
          <li class="settings-inner-item {if $card['address'] == 0} cur {/if}" data-visible="0">
            <span class="vertical-m">全部可见</span>
          </li>
          <li class="settings-inner-item {if $card['address'] == 1} cur {/if}" data-visible="1">
            <span class="vertical-m">互收藏可见</span>
          </li>
          <li class="settings-inner-item {if $card['address'] == 2} cur {/if}" data-visible="2">
            <span class="vertical-m">自己可见</span>
          </li>
        </ul>
      </div>
  </section>
  <!--#=end column-->
</div>
<!--#=end page--> 

<!--#start JS--> 
<script src="..//addons/amouse_ecard/style/js/jquery.1.11.1.js"></script>
<script src="../addons/amouse_ecard/style/js/flytip.js"></script> 
<script>
$(function (){
	var $settingsBox = $(".settings-box");
	var $settingsBoxItem = $settingsBox.find("li");
	var $true = "<span class='true'>√</span>";
	
		$settingsBox.each(function() {
			var $li =$(this).find("li");
			$li.each(function() {
				if($(this).hasClass("cur")){
					$(this).prepend($true);	
				}
			});
				
      	});
		$settingsBoxItem.click(function(){
			var $this = $(this);
			var visible = $this.data("visible");
			var type = $this.parent().data("type");			
			if(!$this.hasClass("cur")){
				$.ajax({
					"type": "post",
					"url": "{php echo $this->createMobileUrl('privateSet',array('op' => 'ajax'))}",
					"data": {"visible": visible, "type": type, "id":{$id}},
					"dataType": "json",
					"success": function(data){
						if(data.success){
							$this.addClass("cur").siblings().removeClass("cur");
							$this.prepend($true).siblings().children("span").remove(".true");
							$.flytip("设置成功");
						}else{
							$.vAlert(data.desc);
						}
					}
				});
			}
		});

});

document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.call('hideOptionMenu');
});

</script>
<!--#end JS-->
</body>
</html>